﻿#include "FLineEdit.h"
#include "../Base/FTheme.h"

FLineEdit::FLineEdit(QWidget *parent)
    : QLineEdit{parent}
{
    QString qss = QString(R"(
QLineEdit {
    border: 1px solid %1;
    background: %5;
    border-radius: 4px;
    padding: 4px;
}
QLineEdit:hover {
    border: 1px solid %2;
}
QLineEdit:focus {
    border: 1px solid %3;
}
QLineEdit:disabled {
    background: 1px solid %4;
}
)").arg(FColors::getBaseColor(FColors::Default).name(QColor::HexArgb),
        FColors::getHoverColor(FColors::Default).name(QColor::HexArgb),
        FColors::getActiveColor(FColors::Default).name(QColor::HexArgb),
        FColors::getDisabledColor(FColors::Default).name(QColor::HexArgb),
        FColors::getBackgroundColor().name(QColor::HexArgb));

    setStyleSheet(qss);
    setContextMenuPolicy(Qt::CustomContextMenu);
}
